/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pfbdial.hpp - Interface for the PegFiniteBitmapDial class
//
// Author: Jim DeLisle
//
// Copyright (c) 1997-2000 Swell Software
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PFBDIAL_HPP_
#define _PFBDIAL_HPP_

enum BitmapDialBmps {
    PBMI_DIAL_BACKGROUND = 0,
    PBMI_DIAL_ANCHOR
};

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
class PegFiniteBitmapDial : public PegFiniteDial
{
    public:
        PegFiniteBitmapDial(const PegRect& Rect, PEGINT MinAngle,
                            PEGINT MaxAngle, PEGLONG MinValue,
                            PEGLONG MaxValue, PEGINT BkgBmp,
                            PEGINT AnchorBitmap = 0,
                            PEGULONG Style = DS_STANDARDSTYLE);

        virtual ~PegFiniteBitmapDial();

        virtual void Draw(const PegRect &Invalid);

        PEGINT GetBitmap(PEGINT Index) const
        {
            if (Index)
            {
                return mAnchorBitmap;
            }
            else
            {
                 return mBkgBitmap;
            }
        }

        PEGINT GetCORX() const { return mCOR.x; }
        PEGINT GetCORY() const { return mCOR.y; }

        void SetBitmap(PEGINT Index, PEGINT BmpId)
        {
            if (Index)
            {
                mAnchorBitmap = BmpId;
            }
            else
            {
                mBkgBitmap = BmpId;
            }
        }

        void SetCOR(PEGINT CORX, PEGINT CORY, PEGBOOL Redraw = FALSE);

        void UseTrueCOR(PEGBOOL Use);

    protected:
        virtual void CalcNeedlePos();
        void DrawToComposite();

        PegPoint mCOR;

        PEGINT mBkgBitmap;
        PEGINT mAnchorBitmap;

        PEGINT mPrivateSurface;

};

#endif // _PFBDIAL_HPP_


